CREATE TABLE [dbo].[TCAMAR_CPAG]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[CO_UNID_CONC] [dbo].[TD_VC_003] NOT NULL,
[FE_AMAR] [dbo].[TD_DT_001] NOT NULL,
[NU_AMAR] [dbo].[TD_VC_008] NOT NULL,
[CO_PROV] [dbo].[TD_VC_020] NOT NULL,
[CO_TIPO_OPER] [dbo].[TD_VC_003] NOT NULL,
[CO_MONE] [dbo].[TD_VC_003] NOT NULL,
[FA_TIPO_CAMB] [dbo].[TD_NU_015_006] NOT NULL CONSTRAINT [DF__TCAMAR_CP__FA_TI__145C0A3F] DEFAULT ((1.000)),
[ST_CONT] [dbo].[TD_VC_001_INTE] NOT NULL CONSTRAINT [DF__TCAMAR_CP__ST_CO__15502E78] DEFAULT ('N'),
[NU_PROC] [dbo].[TD_IN_001] NULL CONSTRAINT [DF__TCAMAR_CP__NU_PR__173876EA] DEFAULT ((0)),
[TI_SITU] [dbo].[TD_VC_003] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCAMAR_CP__CO_US__182C9B23] DEFAULT (suser_sname()),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCAMAR_CP__FE_US__1920BF5C] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL CONSTRAINT [DF__TCAMAR_CP__CO_US__1A14E395] DEFAULT (suser_sname()),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TCAMAR_CP__FE_US__1B0907CE] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_CPAG] WITH NOCHECK ADD CONSTRAINT [CK__TCAMAR_CP__ST_CO__164452B1] CHECK NOT FOR REPLICATION (([ST_CONT]='P' OR [ST_CONT]='N'))
GO
ALTER TABLE [dbo].[TCAMAR_CPAG] ADD CONSTRAINT [PK__TCAMAR_C__2F1962B258E70A0D] PRIMARY KEY CLUSTERED  ([CO_EMPR], [CO_UNID_CONC], [FE_AMAR], [NU_AMAR]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TCAMAR_CPAG] ADD CONSTRAINT [FK__TCAMAR_CP__CO_EM__6BAFC5BE] FOREIGN KEY ([CO_EMPR]) REFERENCES [dbo].[TMPARA_TESO] ([CO_EMPR])
GO
ALTER TABLE [dbo].[TCAMAR_CPAG] ADD CONSTRAINT [FK__TCAMAR_CPAG__6ABBA185] FOREIGN KEY ([CO_EMPR], [CO_TIPO_OPER]) REFERENCES [dbo].[TTTIPO_OPER] ([CO_EMPR], [CO_TIPO_OPER])
GO
